#include <bits/stdc++.h>

#define ll long long
#define YES cout << "Yes" << endl
#define NO cout << "No" << endl
const int INF = 1e9;
using namespace std;
/*思考区

*/
void solve()
{
    int n = 0,ans=0;
    cin >> n;
    vector<int> a(n + 1,0);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    for (int i = 2; i <= n; i++) {
        if (a[i] == a[i - 1]) {
            ans++;
        }
    }
    cout << n-ans << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t = 0;
    cin >> t;
    while (t--)
        solve();
    return 0;
}